package com.edgar.plugin.utils;

import android.util.Log;

import java.io.Closeable;
import java.io.IOException;
import java.util.zip.ZipFile;

/**
 * Created by Edgar on 2018/2/10.
 */
public final class IoUtils {

    private static final String TAG = "IOUtils";
    private IoUtils(){}

    public static void closeQuietly(Closeable closeable){
        try {
            if (closeable != null){
                closeable.close();
            }
        } catch (IOException e) {
            Log.e(TAG,"Io close error:"+e.getMessage(),e);
        }
    }

    public static void closeZipFile(ZipFile zipFile){
        try {
            if (zipFile != null){
                zipFile.close();
            }
        } catch (IOException e) {
            Log.e(TAG,"ZipFile close error:"+e.getMessage(),e);
        }
    }
}
